-- grid_opened.lua
-- Created by zouyb Jun/04/2015
-- 某个格子开启后触发下一个引导

return {
    -- 添加格子开启时的回调
    register = function(config)
        local function handle(para)
            -- 目标格子开启
            if para.pos == tonumber(config.para) then
                UIDungeonMgr.getCurLevel().guideMgr:runNext();
            end    
        end

        EventMgr.remove("guide_grid_opened", event.OPEN_GRID);
        EventMgr.register("guide_grid_opened", event.OPEN_GRID, handle);
    end,

    -- 删除格子开启时的回调
    unRegister = function(config)
        EventMgr.remove("guide_grid_opened", event.OPEN_GRID);
    end
};